<?php

use Illuminate\Routing\Router;

Route::group([
    'prefix' => 'admin/Ifttt',
    'namespace' => 'Frieza\\Modules\\Ifttt\\Controllers',
    'middleware' => [
        'web',
        'admin'
    ],
], function (Router $router) {
    //rule
    $router->get('/rule_list', 'RuleController@ruleList');
    $router->get('/create_rule', 'RuleController@createRule');
    $router->get('/rule_list/{id}/edit', 'RuleController@createRule');
    $router->put('/rule_list/{id}', 'RuleController@updateRuleStatus');
    $router->post('/save_rule', 'RuleController@saveRule');
    $router->get('/rule_group', 'IndexController@ruleGroupList');
    $router->post('/rule_group', 'IndexController@ruleGroupSubmit');
    $router->put('/rule_group/{id}', 'IndexController@ruleGroupSubmit');
    //v2 task
    $router->get('/task_list', 'IftttController@task_list');
    $router->get('/task_list/{tab_id}', 'IftttController@task_list');
    $router->get('/create_task', 'IftttController@create_task');
    $router->get('/task_list/{id}/edit', 'IftttController@create_task');
    $router->get('/view/{id}', 'IftttController@create_task');
    $router->post('/save_task', 'IftttController@saveTask');
    $router->post('/edit_task_status', 'IftttController@editTaskStatus');
    $router->get('/search_event', 'IftttController@searchEvent');
    $router->get('/attr_list', 'IftttController@getAttrList');
    $router->get('/get_attr_values', 'IftttController@getAttrValues');
    $router->post('/save_task_rule', 'IftttController@saveTaskRule');
    $router->post('/predict_sql', 'IftttController@predictSql');
    $router->post('/task_check', 'IftttController@taskCheck');
    $router->get('/sql_res', 'IftttController@getPredictSqlResult');
    $router->get('/get_select_rules', 'IftttController@getSelectRules');
});
